package br.siseventos.model;
// Generated 29/10/2012 23:23:36 by Hibernate Tools 3.2.1.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TaServicoPrestador generated by hbm2java
 */
@Entity
@Table(name = "ta_servico_prestador", catalog = "SisEventosDB")
public class TaServicoPrestador extends BaseModel {

    private Integer idtServicoPrestador;
    private TbPrestadorServico tbPrestadorServico;
    private TbServico tbServico;
    private Set<TaAlocacaoServico> taAlocacaoServicos = new HashSet<TaAlocacaoServico>(0);

    public TaServicoPrestador() {
    }

    public TaServicoPrestador(TbPrestadorServico tbPrestadorServico, TbServico tbServico) {
        this.tbPrestadorServico = tbPrestadorServico;
        this.tbServico = tbServico;
    }

    public TaServicoPrestador(TbPrestadorServico tbPrestadorServico, TbServico tbServico, Set<TaAlocacaoServico> taAlocacaoServicos) {
        this.tbPrestadorServico = tbPrestadorServico;
        this.tbServico = tbServico;
        this.taAlocacaoServicos = taAlocacaoServicos;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "idt_servico_prestador", unique = true, nullable = false)
    public Integer getIdtServicoPrestador() {
        return this.idtServicoPrestador;
    }

    public void setIdtServicoPrestador(Integer idtServicoPrestador) {
        this.idtServicoPrestador = idtServicoPrestador;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cod_prestador_servico", nullable = false)
    public TbPrestadorServico getTbPrestadorServico() {
        return this.tbPrestadorServico;
    }

    public void setTbPrestadorServico(TbPrestadorServico tbPrestadorServico) {
        this.tbPrestadorServico = tbPrestadorServico;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cod_servico", nullable = false)
    public TbServico getTbServico() {
        return this.tbServico;
    }

    public void setTbServico(TbServico tbServico) {
        this.tbServico = tbServico;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "taServicoPrestador")
    public Set<TaAlocacaoServico> getTaAlocacaoServicos() {
        return this.taAlocacaoServicos;
    }

    public void setTaAlocacaoServicos(Set<TaAlocacaoServico> taAlocacaoServicos) {
        this.taAlocacaoServicos = taAlocacaoServicos;
    }
}
